gl: Clear current when destroying current's surface
authorBenjamin Otte <otte@redhat.com>
Wed, 22 Dec 2021 18:49:13 +0000 (19:49 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 22 Dec 2021 19:00:52 +0000 (20:00 +0100)
commitc41979931382bc35a839eb7f59e8a6940dc47144
tree050e0d734c22d389d610e8901d48dc48148b021a
parentc5973a630b7060df4d34141b0cf70bbdbaaaf98e
gl: Clear current when destroying current's surface

When destroying the EGLSurface or GLXDrawable of a GdkSurface, make sure
the current context is not still bound to it.

If it is, clear the current context.

Fixes #4554
gdk/gdkglcontext.c
gdk/gdkglcontextprivate.h
gdk/gdksurface.c
gdk/x11/gdkglcontext-glx.c